package com.xuan.controller.pg;

import com.xuan.configuration.result.ResponseResult;
import com.xuan.configuration.result.ResponseResultEnum;
import com.xuan.dto.pg.liuyao.PgLiuYaoDto;
import com.xuan.service.pg.PgLiuYaoService;
import com.xuan.vo.pg.liuyao.PgLiuYaoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 六爻起卦Controller
 */
@RestController
@RequestMapping("/pgLiuYao")
public class PgLiuYaoController {

    @Autowired
    private PgLiuYaoService PgLiuYaoService; // 六爻起卦Service

//********************************************************************************************************************************

    /**
     * 开始起卦
     *
     * @param dto 六爻起卦数据接收类
     * @return 起卦结果
     */
    @PostMapping("/starts")
    public ResponseResult<PgLiuYaoVo> starts(@RequestBody PgLiuYaoDto dto) {

        PgLiuYaoVo vo = PgLiuYaoService.starts(dto);
        return ResponseResult.result(ResponseResultEnum.SUCCESS, "起卦成功", vo);

    }


}
